package com.freewater.library.lending.reader.infrastructure.springconfig;

import com.freewater.library.lending.reader.infrastructure.dao.ReaderDao;
import com.freewater.library.lending.reader.infrastructure.repository.ReaderRepositoryImpl;
import com.freewater.library.lending.reader.model.ReaderIdGenerator;
import com.freewater.library.lending.reader.model.ReaderRepository;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ReaderConfiguration {

    @Bean
    public ReaderRepository readerRepository(ReaderDao readerDao) {
        return new ReaderRepositoryImpl(readerDao);
    }

    @Bean
    public ReaderIdGenerator readerIdGenerator(ReaderDao readerDao) {
        return new ReaderRepositoryImpl(readerDao);
    }
}
